package sites.manager.common.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.util.Date;

@Data
public class Action extends Model<Action> {

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    @NotBlank(message = "资源类型不可为空")
    private String type;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long parent;

    @NotBlank(message = "资源标题不可为空")
    private String title;

    @NotBlank(message = "资源地址不可为空")
    private String actionKey;

    private String icon;

    private String status;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    private Long siteId;
}
